package s17.ch20.ex3;

import java.math.BigDecimal;
import java.util.ArrayList;

public class AmountParser implements Parser {

	@Override
	public AmountList parse(String data) {
		String[] numbers = data.split(",");
		AmountList amountList = new AmountList();
		amountList.setAmount(new ArrayList<BigDecimal>());
		for (String string : numbers) {
			BigDecimal a=new BigDecimal(string);
			float b=a.floatValue();
			amountList.getAmount().add(b);
			//amountList.getAmount().add(new BigDecimal(string));
		}
		return amountList;
	}

}
